<%--
  Created by IntelliJ IDEA.
  User: test123456test
  Date: 2021/6/3
  Time: 8:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/js/jquery-1.12.4.js"></script>
</head>
<body>
<button onclick="findAll()">查询所有</button>
<button onclick="find()">查询ID为1</button>
<script type="text/javascript">
    function findAll() {
        $.ajax({
            url: "${pageContext.request.contextPath}/rest/users",
            type: "get",
            success: function (result) {
                console.log("查询所有")
                console.log(result)
            }
        })
    }

    function find() {
        $.ajax({
            url: "${pageContext.request.contextPath}/rest/users/1",
            type: "get",
            success: function (result) {
                console.log("ID1    ")
                console.log(result)
            }
        })
    }


</script>
</body>
</html>
